@extends('admin.base')

@section('css')
<style>
    .layui-table-cell{
        height: 50px;
        line-height: 50px;
    }
</style>
@endsection

@section('content')
    <div class="layui-card layui-form">
        <div class="layui-card-header layuiadmin-card-header-auto">
            <div class="layui-inline">
                <label class="layui-form-label">名称：</label>
                <div class="layui-input-inline">
                    <input type="text" name="title" id="title" lay-verify="" autocomplete="off" class="layui-input">
                </div>
            </div>
            <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchForm" id="searchForm"><i class="layui-icon"></i>查询
            </button>
        </div>
        <div class="layui-card-body">

            <script type="text/html" id="toolbarDemo">
                @if(auth("admin")->user()['parent_id'] == 0)
                    <div class="layui-btn-container">
                        <button class="layui-btn layui-btn-sm layui-btn-sm data-add-btn" lay-event="refresh"><i class="fa fa-refresh"></i> 刷新 </button>
                        <a href="javascript:"  class="layui-btn btnOption   layui-btn-sm  btnAdd" id="add" data-param="" lay-event="add">
                            <i class="fa fa-plus" aria-hidden="true"></i> 添加
                        </a>
                    </div>
                @endif
            </script>

            <table id="dataTable" lay-filter="dataTable"></table>

            <script type="text/html" id="switchTpl">
                <input type="checkbox" name="status"  value="@{{d.id}}"  lay-skin="switch" lay-text="展示|隐藏" lay-filter="lay-status-switch" wy-data="{url:'{{route('admin.websites.status')}}'}" @{{d.status == 1 ? 'checked' : '' }} >
            </script>

            <script type="text/html" id="aTpl">
                <a href="http://@{{d.domains}}" target="_blank">@{{d.domains}}</a>
            </script>
            {{--图片--}}
            <script type="text/html" id="imgurl">
                <img src="@{{d.image_logo}}" class="layui-img-click" style="max-width: 100%;max-height:100%; ">
            </script>


            <script type="text/html" id="options">
                <div class="layui-btn-group">
                    <a lay-href="{{route('admin.articles.index')}}?website_id=@{{d.id}}" target="_blank" lay-text="@{{d.names}}" class="layui-btn layui-btn-sm" style="margin-right: 10px !important;" >文章</a>
                    <a class="layui-btn layui-btn-sm" style="margin-right: 10px !important;" lay-event="edit"  lay-id="@{{d.id}}">编辑</a>
                    <a lay-href="{{route('admin.websitesTopic.index')}}?id=@{{d.id}}" class="layui-btn layui-btn-sm" style="margin-right: 10px !important;" lay-text="栏目-@{{d.names}}" target="_blank">栏目</a>
                    <a lay-href="{{route('admin.websitequick.index')}}?id=@{{d.id}}" class="layui-btn layui-btn-sm" style="margin-right: 10px !important;" lay-text="快速连接-@{{d.names}}" target="_blank">快速连接</a>
                    <a class="layui-btn layui-btn-danger layui-btn-sm layui-data-delete"  wy-data="{url:'{{route('admin.websites.delete')}}',id:'@{{d.id}}'}">删除</a>
                </div>
            </script>
        </div>
    </div>
@endsection

@section('script')
    @include('admin.websites._js')
@endsection

